package demo2;

import java.util.Arrays;

public class Test {

    public static void main(String[] args) {
        Student[] students = new Student[3];
        students[0] = new Student("kay", 20, 88.6);
        students[1] = new Student("ben", 18, 87.4);
        students[2] = new Student("alik", 19, 89.4);

        NameComparator nameComparator = new NameComparator();
        AgeComparator ageComparator = new AgeComparator();
        ScoreComparator scoreComparator = new ScoreComparator();
        Arrays.sort(students, scoreComparator);
        // Arrays.sort(students);
        System.out.println(Arrays.toString(students));

    }
    public static void main1(String[] args) {
        Student[] students = new Student[3];
        students[0] = new Student("kay", 20, 88.6);
        students[1] = new Student("ben", 18, 87.4);
        students[2] = new Student("alik", 19, 89.4);
        Arrays.sort(students);

        System.out.println(Arrays.toString(students));
    }
}
